﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Site.master" CodeBehind="ManageUsers.aspx.cs"
    Inherits="Se7en.Admin.Web.Pages.ManageUser" %>

<%@ Register Src="../Controls/UserEdit.ascx" TagName="UserEdit" TagPrefix="uc1" %>
<%@ Register Src="../Controls/RoleList.ascx" TagName="RoleList" TagPrefix="uc1" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <asp:UpdatePanel runat="server">
        <ContentTemplate>
            <erm:ERMGrid ID="grdMangeUser" runat="server" EnableRowClick="false" EnableMultiSelect="false"
                DataKeyNames="UserID" OnPageIndexChanged="grdMangeUser_PageIndexChanged" OnActionClick="grdMangeUser_ActionClick"
                OnRefresh="grdMangeUser_Refresh" OnAddNew="grdMangeUser_AddNew" PageSize="10"
                GridStyle="SkyBlue" AutoGenerateColumns="false" EnableRowHover="false" Width="100%">
                <Menu VisibleAdd="true" VisibleRefresh="true" VisibleDelete="false" />
                <Columns>
                    <asp:BoundField HeaderText="Login Name" DataField="LoginName" ItemStyle-ForeColor="Blue"
                        ItemStyle-Font-Bold="true" />
                    <asp:BoundField HeaderText="Email" DataField="Email" />
                    <asp:CheckBoxField HeaderText="Active" DataField="Active" ItemStyle-HorizontalAlign="Center" />
                    <erm:ActionColumn HeaderText="Actions" ItemStyle-Width="120px">
                        <Actions>
                            <erm:Action Name="Edit" Text="Edit" />
                            <erm:Action Name="UpdateRole" Text="Update Role" />
                        </Actions>
                    </erm:ActionColumn>
                </Columns>
            </erm:ERMGrid>
        </ContentTemplate>
    </asp:UpdatePanel>
    <erm:ErmGroupBox runat="server" ID="gbAccount" IsModal="true" ModalBehaviorId="bhvAccount" Width="800"
        HeaderBackground="Silver" HeaderText="User Information" Style="display: none">
        <ContentTemplate>
            <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                <ContentTemplate>
                    <uc1:UserEdit ID="ctlUserEdit" runat="server" OnSuccess="ctlUserEdit_Success" />
                </ContentTemplate>
            </asp:UpdatePanel>
        </ContentTemplate>
    </erm:ErmGroupBox>
    <asp:HyperLink ID="HyperLink1" runat="server"></asp:HyperLink>
    <ajax:ModalPopupExtender ID="modalAccount" runat="server" BackgroundCssClass="modalBackground"
        BehaviorID="bhvAccount" PopupControlID="gbAccount" TargetControlID="HyperLink1">
    </ajax:ModalPopupExtender>
    <erm:ErmGroupBox runat="server" ID="gpRole" IsModal="true" ModalBehaviorId="bhvRole" Width="650"
        HeaderBackground="Silver" HeaderText="Role List" Style="display: none;">
        <ContentTemplate>
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <uc1:RoleList ID="ctlRoleList" runat="server" MultipleSelect="true" />
                    <asp:Button ID="btnAssignRole" Text="Assign Role(s)" runat="server" CssClass="btn grey" OnClick="btnAssignRole_Click" />
                    <asp:Button ID="btnRemoveRole" Text="Remove Role(s)" runat="server" CssClass="btn grey" OnClick="btnRemoveRole_Click"/>
                    <asp:Button ID="btnAssignAllRole" Text="Assign All Roles" runat="server" CssClass="btn grey" OnClick="btnAssignAllRole_Click"/>
                    <asp:Button ID="btnRemoveAllRole" Text="Remove All Roles" runat="server" CssClass="btn grey" OnClick="btnRemoveAllRole_Click"/>
                    <asp:Button ID="btnCancel" Text="Cancel" runat="server" CssClass="btn grey" OnClientClick="$find('bhvRole').hide();return false;" />
                </ContentTemplate>
            </asp:UpdatePanel>
        </ContentTemplate>
    </erm:ErmGroupBox>
    <asp:HyperLink ID="HyperLink2" runat="server"></asp:HyperLink>
    <ajax:ModalPopupExtender ID="modalUpdateRole" runat="server" BackgroundCssClass="modalBackground"
        BehaviorID="bhvRole" PopupControlID="gpRole" TargetControlID="HyperLink2">
    </ajax:ModalPopupExtender>
</asp:Content>
